home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / mus / play / DoSoundv2_6.lha / DoSoundv2_6 / s / dogetsound.amirx < prev    next >
Encoding:
Text File  |  1997-07-18  |  7.6 KB  |  3 lines

  1. /* $VER: 2.6 for DoSound V2.6
  2.  */
  3. addlib("rexxarplib.library",0,-30,0);options results;call getenv(ha);host=result;address(host);getmynick;nick=result;'raw notice' nick' :' "DoGetSound is now active";if left(host,5) ~=AMIRC then exit;sdcnt=0;stuff="";call setenv(stp,0);do while host ~="";options results;call getclip(snd);if result=1 then;do;call setclip(snd,0);call compar;end;call getstp;wave="";wav="";wavey="";getmynick;nick=result;if exists('ram:env/ready') then;do;call open(file,'ram:env/ready','r');parse value readln(file) with getwav;call close(file);end;if exists('ram:env/nicky') then;do;call open(file,'ram:env/nicky','r');parse value readln(file) with nck;call close(file);end;if exists('ram:env/dosound.config') then;do;call open(file,'ram:env/dosound.config','r');parse value readln(file) with ag","as","maxg","smax;call close(file);end;else;do;call open(file,'ram:env/dosound.config','w');call writeln(file,"off,on,150,1000");call close(file);end;b=d2c('02');ref=?;pccrap="";if stp=1 then;do;exit;end;call retreaved;getline;address(host);address;if getwav=1 then;do;if line.command=PRIVMSG then;do;parse value line.rest with ":" rst;parse value rst with cmd1 cmd2 subject junk mjunk sise;call setenv(aa,cmd2);if length(sise)>1 then;do;sise=strip(sise);if sise="" then sise=maxg*1000+1;sise=left(sise,length(sise)-1);if length(cmd1)>0 then;do;lnth=length(cmd1)-1;cmd1=right(cmd1,lnth);end;end;subject=upper(subject);txt=cmd1 cmd2 subject;if cmd1= DCC then;do;if sise<=maxg*1000 then;do;if exists('ram:wfile') then;do;call open(rfile,'ram:wfile','r');do while ~eof(rfile);parse value readln(rfile) with wave;wave=upper(wave);if txt='DCC SEND' wave then;do;call setclip(wv,wave);call getclip(tem);temps=result;address(host);resumewave=temps||'/'wave;if exists(resumewave) then;do;address command 'delete 'resumewave;end;'say' "/dcc get" nck wave temps||'/'wave;call delfile;if exists('ram:nwav') then;do;call open(nfile,'ram:nwav','a');if not~=1 then call writeln(nfile,wave sise);not="";call close(nfile);end;else;do;call open(nfile,'ram:nwav','w');call writeln(nfile,wave sise);call close(nfile);end;end;end;end;call close(rfile);call delfile;end;else;do;'raw notice' nck' :'"SORRY I'll buy the CD";end;end;end;end;parse value line.rest with ":" stuff shit "*" pccrap "*" crap "*" sz "*" garb;parse value line.rest with ":"poop":"sz;parse value sz with sz poopoo;if left(sz,1)='(' then sz=right(sz,length(sz)-1);if sz="" then sz="NA";shit=strip(shit);if upper(stuff)=!||upper(nick) then call sendingpc;if length(stuff)>0 then;do;lnth=length(stuff)-1;stuff=right(stuff,lnth);end;parse value shit with "~" acrap;if left(word(acrap,1),1)='~' then ref=DS2_X;if left(word(acrap,1),1)='*' then ref=DSx;if pccrap ~="" then ref=wo;parse value line.prefix with nck "!" junk;snd='SOUND';if stuff=snd then call setclip(snd,1);if stuff=getsound then call sending;if line.command=PRIVMSG then call vers;stuff="";end;getstp:;arg;if exists('ram:env/stp') then;do;call open(file,'ram:env/stp','r');parse value readln(file) with stp;call close(file);end;address;return stp;doit:;parse value shit with wave"."junk;wave=wave".wav";file=wave"/"nck"/"sz"/"ref;if exists('ram:soundin')=0 then;do;call open('sfile','ram:soundin','w');call writeln('sfile',file);call close('sfile');address command 'rx getsfile.amirx refresh listings';call checkauto;return;end;call open('sfile','ram:soundin','a');call writeln('sfile',file);call close('sfile');address command 'rx getsfile.amirx refresh listings';call checkauto;return;checkauto:;if ag=on then;do;call setenv(wfile,wave);call setenv(ready,1);call setenv(nicky,nck);call setenv(sget,1);agwave=wave",(NK) "nck","sz","ref;address command 'rx getsfile.amirx' agwave;end;return;compar:;wave=shit;parse value wave with wave"."junk;wave=upper(wave);if exists('ram:retreaved') then;do;call open(tfile,'ram:retreaved','r');end;call open(sfile,'ram:soundfile','r');call open(gfile,'ram:soundin','r');do while ~eof(sfile);parse value readln(sfile) with junk":"wave2;parse value wave2 with wave2"."junk;wave2=upper(wave2);if wave=wave2 then signal closefile;end;if exists('ram:retreaved') then;do;do while ~eof(tfile);parse value readln(tfile) with wave2;parse value wave2 with wave2"."junk;wave2=upper(wave2);if wave=wave2 then signal closefile;end;end;if exists('ram:soundin') then;do;do while ~eof(gfile);parse value readln(gfile) with wave2 junk;parse value wave2 with wave2"."junk;wave2=upper(wave2);if wave=wave2 then signal closefile;end;call close(gfile);call close(sfile);end;call doit;return;closefile:;call close(tfile);call close(sfile);call close(gfile);return;retreaved:;if exists('ram:nwav') then;do;if exists('ram:nwavs') then;do;address command 'delete ram:nwavs';end;call open(nfile,'ram:nwav','r');do while ~eof(nfile);parse value readln(nfile) with wf;if wf=wave then not=1;end;call close(nfile);call open(nfile,'ram:nwav','r');do while ~eof(nfile);parse value readln(nfile) with wavey"."junk size;size=strip(size);if wavey="" then;do;call close(nfile);return;end;if exists(temps) then;do;address command 'list 'temps 'lformat=%n%L to ram:twavs';end;call open(tfile,'ram:twavs','r');do while ~eof(tfile);parse value readln(tfile) with wav"."siz;if wav=wavey then;do;if length(siz)>3 then lnth=length(siz)-3;rsize=right(siz,lnth);if rsize=size then;do;call setenv(gotit,1);size=0;rsize=0;call setenv(nwav,wavey);address command 'rx getsfile.amirx gotit';end;end;end;call close(tfile);end;end;call close(nfile);return;sending:;parse value shit with wave xtrashit;wave=left(wave,length(wave)-1);call setenv(wfile,wave);call mywavs;if nope=0 then return;if as=on then;do;if exists('ram:env/maxcnt') then;do;call getenv(maxcnt);sdcnt=result;end;if smax="" then smax=10;if sdcnt<smax then;do;waf="sounds:"wave;if ref=DSx then call compress;'raw notice' nck' :'"File " b||wave||b " is ready to beam aboard";'say /dcc send' nck waf;sdcnt=sdcnt+1;call setenv(maxcnt,sdcnt);end;return;end;'raw notice' nck' :'"Sorry" b||Transporter||b " is Off Line";return;sendingpc:;parse value line.prefix with nck "!" junk;parse value shit with wave xtrashit;call setenv(wfile,wave);call mywavs;if nope=0 then return;if as=on then;do;if exists('ram:env/maxcnt') then;do;call getenv(maxcnt);sdcnt=result;end;if smax="" then smax=10;if sdcnt<smax then;do;waf="sounds:"wave;'raw notice' nck' :'"File " b||wave||b " is ready to beam aboard";'say /dcc send' nck waf;sdcnt=sdcnt+1;call setenv(maxcnt,sdcnt);end;return;end;'raw notice' nck' :'"Sorry" b||Transporter||b " is Off Line";return;mywavs:;call open(sfile,'ram:soundfile','r');do while ~eof(sfile);parse value readln(sfile) with dir":"waf;parse value wave with wave1"."junk;parse value waf with wave2"."junk;if upper(wave1)=upper(wave2) then;do;call close(sfile);nope=1;return nope;end;end;'say /msg' nck "The file " b||wave||b " is not on board";nope=0;call close(sfile);return nope;vers:;if left(stuff,7)=VERSION then;do;'raw notice' nck ' :'VERSION b||"DoSound"||b||" © V2.6 -- Playing Wavs and Going where no man has gone before";end;return;delfile:;call getclip(wv);wave=result;call open(file,'ram:wfile','r');do while ~eof(file);parse value readln(file) with rwave;if rwave=""then leave;if upper(rwave) ~=upper(wave) then;do;if exists('ram:twfile') then;do;call open(tfile,'ram:twfile','a');call writeln(tfile,rwave);call close(tfile);end;else;do;call open(tfile,'ram:twfile','w');call writeln(tfile,rwave);call close(tfile);end;end;end;call close(file);address command 'delete ram:wfile';if exists('ram:twfile') then;do;address command 'copy ram:twfile to ram:wfile';address command 'delete ram:twfile';end;return;compress:;waffy=wave||x;if ~exists ram:waffy then;do;address command 'copy' waf 'to ram:'wave;address command 'xpackit ram:'wave 'm=sqsh';address command 'rename ram:'wave' as ram:'waffy;waf='ram:'waffy;end;return